package BanyuanClub.Work.Day0304;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyPicture {
    public static void main(String[] args) {

    try(FileInputStream fis = new FileInputStream("picture.jpeg")){
        FileOutputStream fos = new FileOutputStream("picture2.jpeg");
        int end;
        byte[] but = new byte[1024];
        while ((end = fis.read(but)) != -1){
            fos.write(but,0,end);
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    }
}
